<template>
  <CategorySelector :disabled="scene==1" style="margin-bottom: 10px"></CategorySelector>
  <el-card>
     <SpuList v-if="scene===1" @changeScene="saveScene" @getSpuInfo="saveSpuInfo"></SpuList>
     <SpuForm v-if="scene===2" @changeScene="saveScene" :currentSpuInfo="currentSpuInfo"></SpuForm>
     <SkuForm v-if="scene===3" @changeScene="saveScene" :currentSpuInfo="currentSpuInfo"></SkuForm>
  </el-card>
</template>

<script lang="ts">
import CategorySelector from "@/components/CategorySelector/index.vue";
import SpuList from './components/SpuList.vue'
import SpuForm from './components/SpuForm.vue'
import SkuForm from './components/SkuForm.vue'
export default {
  name: "Spu",
  components: { CategorySelector,SpuList,SpuForm,SkuForm },
}
</script>
<script lang="ts" setup>
import { ref } from 'vue'

const scene =ref(1)
const currentSpuInfo = ref([])
const saveScene = (val:number)=>{
  scene.value = val
}

const saveSpuInfo =(spuInfo)=>{
currentSpuInfo.value = spuInfo
}
</script>

<style>
</style>